package entity

import "time"

// AccountEntity settings
type MailLogEntity struct {
	ID         *string   `gorm:"primaryKey;size:50"`
	AccountID  *string   `gorm:"column:account_id;size:50"`
	From       *string   `gorm:"column:from"`
	To         *string   `gorm:"column:to"`
	Cc         *string   `gorm:"column:cc"`
	Bcc        *string   `gorm:"column:bcc"`
	Subject    *string   `gorm:"column:subject"`
	Body       *string   `gorm:"column:body"`
	RequestID  *string   `gorm:"column:request_id;index;size:50"`
	CreatedAt  time.Time `gorm:"column:created_at;index"`
	Success    bool      `gorm:"column:success"`
	FailReason *string   `gorm:"column:fail_reason"`
}

// TableName name
func (s *MailLogEntity) TableName() string {
	return "mail_log"
}

// Create 创建记录
func (s *MailLogEntity) Create() bool {
	return CheckDbRes(GetDb().Create(s))
}
